import request from "@/utils/request";

// 获得工资单分页
export function getWagesPage(query) {
  return request({
    url: "/store/wages/page",
    method: "get",
    params: query,
  });
}

// 更新工资单
export function UpdateWages(data) {
  return request({
    url: "/store/wages/update",
    method: "post",
    data: data,
  });
}

// 工资单详情
export function getWagesInfo(data) {
  return request({
    url: "/store/wages/info",
    method: "post",
    data: data,
  });
}

// 工资单历史
export function getWagesHistoryPage(query) {
  return request({
    url: "/store/wages/his",
    method: "get",
    params: query,
  });
}

// 工资单导出
export function ExlWages(query) {
  return request({
    url: "/store/wages/exl",
    method: "get",
    params: query,
    responseType: "blob",
  });
}

// 工资单确认
export function ApproveWagesInfo(data) {
  return request({
    url: "/store/wages/approve",
    method: "post",
    data: data,
  });
}

// 工资单生成
export function generatePayroll(query) {
  return request({
    url: "/store/wages/job",
    method: "get",
    params: query,
  });
}

// 获取岗位精简信息列表
export function getListAllSimple(query) {
  return request({
    url: "/system/post/list-all-simple",
    method: "get",
    params: query,
  });
}

// 新增工资单
export function AddWages(data) {
  return request({
    url: "/store/wages/add",
    method: "post",
    data: data,
  });
}

// 用户考勤添加查询
export function getUserWork(query) {
  return request({
    url: "/system/user/user/work",
    method: "get",
    params: query,
  });
}

// 获取部门精简信息列表
export function listSimpleDepts() {
  return request({
    url: "/system/dept/list-all-simple",
    method: "get",
  });
}

// 获取岗位精简信息列表
export function getPostSimpleList(query) {
  return request({
    url: "/system/post/list-all-simple",
    method: "get",
    params: query,
  });
}
